package com.wyz.service;

import com.wyz.dao.UserDao;
import com.wyz.entity.User;

import my.db.QueryHelper;

public class UserService {
	
	private UserDao dao = new UserDao();
	
	/**
	 * 增加
	 * */
	public void save(User user) {
		dao.save(user);
	}
	
	/**
	 * 修改个人信息表
	 * */
	public void update(User user,String email,String userName) {
		dao.update(user,email,userName);
	}
	
	/**
	 * 修改密码
	 * 
	 * 1
	 * */
	public void changePassword(User user,String password) {
		dao.changePassword(user,password);
	}
	
	/**
	 * 判定账号密码正确
	 * 
	 * 登陆使用
	 * */
	public int verify(String inputPhoneNumber,String inputPassword) {
		return dao.verify(inputPhoneNumber, inputPassword);
	}
	public User findByPhoneNumber(String inputPhoneNumber) {
		return dao.findByPhoneNumber(inputPhoneNumber);
	}
	public User findById(Long id) {
		return dao.findById(id);
	}
	public void updateFlag(User user ,int flag) {
		dao.updateFlag(user, flag);
	}
	public static void main(String[] args) {
		UserService service=new UserService();
		System.out.println(service.verify("12345679", "1234546"));
	}

}
